function Makequ(data) {
    console.log(data)
    $.post("/yuezhi/compage/que",{"data":data},function (data) {
        window.location="/yuezhi/compage/load"
    })
}

function  checkans() {
    let ans = $("#ans").val().trim();
    console.log(ans)
    let com = $("#comp").text();
    console.log(com)
    $.post("/yuezhi/compage/ans",{"stem":com,"ans":ans},function (data) {
        if(data.data==ans){
            // console.log(data.msg)
            // if (data.msg =="回答正确"){
            $("#msg").text("答案正确")
        }else {
            $("#msg").text("答案错误")
        }
    })
}
var flag
function Collectsss(obj,language,stem,diff,id) {
    console.log(id)
    if (id == null) {
        window.location = "/yuezhi/login/load"
    } else {
        $.post("/yuezhi/Collect/col", {"lan": language, "stem": stem, "diff": diff, "id": id}, function (data) {
            if (data.msg == "收藏成功！") {
                alert("收藏成功！")
                console.log("22222")
                obj.innerText = "已收藏"
            } else {
                if (data.msg == "已收藏！") {
                    console.log("11111")
                    alert("已收藏")
                    obj.innerText = "已收藏"
                    flag = false
                }
            }
        })
    }
}

